import request from "../utils/request";

export function rolesDict() {
    return request({
        url: "role/rolesDict",
        method: 'get',
    })
}

export function roles(bean) {
    return request({
        url: "role/roles",
        method: 'get',
        params: {
            ...bean
        }
    })
}

export function getRoleById(id) {
    return request({
        url: "role/get/" + id,
        method: 'get',
    })
}

export function deleteRoleById(id) {
    return request({
        url: "role/delete",
        method: 'post',
        data: {
            id
        }
    })
}

export function addRole(bean) {
    return request({
        url: "role/add",
        method: 'post',
        data: {
            ...bean
        }
    })
}

export function updateRole(bean) {
    return request({
        url: "role/update",
        method: 'post',
        data: {
            ...bean
        }
    })
}

export function rolesExport(ids) {
    return request({
        url: "role/export",
        method: 'post',
        responseType: "blob",
        data: {
            ids
        }
    })
}